#include "AsyncProcessor.h"
#include "QueryCallback.h"

void AsyncProcessor::AddAsyncCallback(QueryCallback &&callbk)
{
    vec_callback.emplace_back(std::move(callbk)); 
}

void AsyncProcessor::SparkIfReadyA()
{
    for (auto it = vec_callback.begin(); it != vec_callback.end(); )
    {
        if (it->SparkIfReady())
        {
            it = vec_callback.erase(it);
        }
        else
        {
            it++;
        }
    }
}